From: Carlos Garnacho Date: Thu, 1 Apr 2021 17:25:24 +0000 (+0200) Subject: keyboard: Always emit ::pressed late on keys with variants X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~45 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=82c2f293a05579e116c04b7a84e1a95599eb5b1a;p=gnome-shell.git keyboard: Always emit ::pressed late on keys with variants When we press a key with variants, we used to prevent an early ::pressed, because a long press could show the options popover, and the press be undone. In addition, this long press could move to one of the suboptions, and be released there. For this case we also want this late emission of the ::pressed signal. This makes the "tap, drag, release" pattern work on the regular OSK keys, in addition to the emoji panel. Part-of: --- diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index c6d6fab60..bc72d77f3 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -296,7 +296,6 @@ var Key = GObject.registerClass({ this._capturedEventId = 0; this._unmapId = 0; - this._longPress = false; } _onDestroy() { @@ -334,14 +333,13 @@ var Key = GObject.registerClass({ _press(key) { this.emit('activated'); - if (key !== this.key || this._extendedKeys.length === 0) + if (this._extendedKeys.length === 0) this.emit('pressed', this._getKeyval(key), key); if (key == this.key) { this._pressTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, KEY_LONG_PRESS_TIME, () => { - this._longPress = true; this._pressTimeoutId = 0; this.emit('long-press'); @@ -365,12 +363,11 @@ var Key = GObject.registerClass({ this._pressTimeoutId = 0; } - if (!this._longPress && key === this.key && this._extendedKeys.length > 0) + if (this._extendedKeys.length > 0) this.emit('pressed', this._getKeyval(key), key); this.emit('released', this._getKeyval(key), key); this._hideSubkeys(); - this._longPress = false; } cancel() {